﻿using System;
using Microsoft.EntityFrameworkCore.Metadata;
using Microsoft.EntityFrameworkCore.Migrations;

namespace JYJ.AiYard.Migrations
{
    public partial class Add_User_Dept_ClientRegister_Enities : Migration
    {
        protected override void Up(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.CreateTable(
                name: "Tb_ClientRegister",
                schema: "Dbo",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    Station_ID = table.Column<long>(maxLength: 65, nullable: false),
                    Client_ID = table.Column<string>(maxLength: 65, nullable: true),
                    Client_Name = table.Column<string>(maxLength: 65, nullable: true),
                    Client_Type = table.Column<string>(maxLength: 65, nullable: true),
                    Client_Stop = table.Column<bool>(maxLength: 65, nullable: false),
                    Client_OS = table.Column<string>(maxLength: 65, nullable: true),
                    Client_SoftVersion = table.Column<string>(maxLength: 128, nullable: true),
                    Client_Modal = table.Column<string>(maxLength: 128, nullable: true),
                    TenantId = table.Column<int>(maxLength: 65, nullable: false),
                    CreationTime = table.Column<DateTime>(maxLength: 65, nullable: false),
                    CreatorUserId = table.Column<long>(maxLength: 65, nullable: true),
                    LastModifierUserId = table.Column<long>(maxLength: 65, nullable: true),
                    LastModificationTime = table.Column<DateTime>(maxLength: 65, nullable: true),
                    IsDeleted = table.Column<bool>(maxLength: 65, nullable: false),
                    DeleterUserId = table.Column<long>(maxLength: 65, nullable: true),
                    DeletionTime = table.Column<DateTime>(maxLength: 65, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Tb_ClientRegister", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Tb_Depart",
                schema: "Dbo",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    Station_ID = table.Column<long>(maxLength: 65, nullable: false),
                    Depart_Code = table.Column<string>(maxLength: 65, nullable: true),
                    Depart_Name = table.Column<string>(maxLength: 256, nullable: true),
                    Depart_Id = table.Column<long>(maxLength: 256, nullable: true),
                    Depart_PCode = table.Column<string>(maxLength: 65, nullable: true),
                    Depart_Desc = table.Column<string>(maxLength: 65, nullable: true),
                    TenantId = table.Column<int>(maxLength: 65, nullable: false),
                    CreationTime = table.Column<DateTime>(maxLength: 65, nullable: false),
                    CreatorUserId = table.Column<long>(maxLength: 65, nullable: true),
                    LastModifierUserId = table.Column<long>(maxLength: 65, nullable: true),
                    LastModificationTime = table.Column<DateTime>(maxLength: 65, nullable: true),
                    IsDeleted = table.Column<bool>(maxLength: 65, nullable: false),
                    DeleterUserId = table.Column<long>(maxLength: 65, nullable: true),
                    DeletionTime = table.Column<DateTime>(maxLength: 65, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Tb_Depart", x => x.Id);
                });

            migrationBuilder.CreateTable(
                name: "Tb_User",
                schema: "Dbo",
                columns: table => new
                {
                    Id = table.Column<long>(nullable: false)
                        .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn),
                    Station_ID = table.Column<long>(maxLength: 65, nullable: false),
                    User_Dept = table.Column<long>(maxLength: 65, nullable: false),
                    User_No = table.Column<string>(maxLength: 65, nullable: true),
                    User_Name = table.Column<string>(maxLength: 65, nullable: true),
                    User_Sex = table.Column<int>(maxLength: 65, nullable: false),
                    User_Birthday = table.Column<DateTime>(maxLength: 65, nullable: false),
                    User_Type = table.Column<int>(maxLength: 65, nullable: false),
                    User_Tel = table.Column<string>(maxLength: 65, nullable: true),
                    User_Mobile = table.Column<string>(maxLength: 65, nullable: true),
                    User_Address = table.Column<string>(maxLength: 512, nullable: true),
                    User_IDType = table.Column<int>(maxLength: 65, nullable: false),
                    User_IDNO = table.Column<string>(maxLength: 65, nullable: true),
                    User_Education = table.Column<int>(maxLength: 65, nullable: false),
                    User_Opertion = table.Column<int>(maxLength: 65, nullable: false),
                    User_Password = table.Column<string>(maxLength: 65, nullable: true),
                    TenantId = table.Column<int>(maxLength: 65, nullable: false),
                    CreationTime = table.Column<DateTime>(maxLength: 65, nullable: false),
                    CreatorUserId = table.Column<long>(maxLength: 65, nullable: true),
                    LastModifierUserId = table.Column<long>(maxLength: 65, nullable: true),
                    LastModificationTime = table.Column<DateTime>(maxLength: 65, nullable: true),
                    IsDeleted = table.Column<bool>(maxLength: 65, nullable: false),
                    DeleterUserId = table.Column<long>(maxLength: 65, nullable: true),
                    DeletionTime = table.Column<DateTime>(maxLength: 65, nullable: true)
                },
                constraints: table =>
                {
                    table.PrimaryKey("PK_Tb_User", x => x.Id);
                });
        }

        protected override void Down(MigrationBuilder migrationBuilder)
        {
            migrationBuilder.DropTable(
                name: "Tb_ClientRegister",
                schema: "Dbo");

            migrationBuilder.DropTable(
                name: "Tb_Depart",
                schema: "Dbo");

            migrationBuilder.DropTable(
                name: "Tb_User",
                schema: "Dbo");
        }
    }
}
